import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 设备信息
 */
@Entity('device_device')
export class DeviceDeviceEntity extends BaseEntity {
  @Column({ comment: '名称', nullable: true })
  name: string;

  @Index({ unique: true })
  @Column({ comment: '编号', nullable: true })
  serialNumber: string;

  @Column({ comment: '密码', nullable: true })
  password: string;

  @Column({ comment: 'ICCID', nullable: true })
  iccid: string;

  @Column({ comment: '预警手机号', nullable: true })
  alertPhone: string;

  @Column({ comment: '入网时间', type: 'datetime', nullable: true })
  networkTime: Date;

  @Column({ comment: '客服电话', nullable: true })
  servicePhone: string;

  @Column({ comment: '常见问题', type: 'text', nullable: true })
  faq: string;

  @Column({ comment: '使用说明', type: 'text', nullable: true })
  instructions: string;

  @Column({ comment: '设备状态', dict: ['在线', '离线'], default: 1 })
  status: number;
 
  @Column({ comment: '所属租户ID', nullable: true })
  tenantId: number;
}